Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ZTP] Improvements to the connectivity-check plugin #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rajendra-dendukuri
Copy link
Collaborator

  • The user can now specify arguments that can be passed on to ping command when performing the connectivity check. The "args" field in the configuration section of the ztp.json needs to be specified.

  • The user can choose to restart dhcp if connectivity check fails in its first attempt. This is useful when the switch has rebooted and all the in-band interfaces are not yet active. Use "dhcp" : true in the configuration section of the ztp.json.

  • Added unit test cases

@dgsudharsan
Copy link
Contributor

@liorghub Can you please review?

@@ -61,30 +61,48 @@ class ConnectivityCheck:
iter_list = list(_host_list)
# Loop through current host list
for host in iter_list:
if interface is not None and not isString(interface):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check required? The interface is parsed as string in line 130 and cannot be other type right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Removed this redundant check.

else:
# Discard invalid hosts
_host_list.remove(host)

if len(_host_list) == 0:
break

if dhcp:
logger.info('Restarting networking to establish connectivity')
Copy link

@liorghub liorghub Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider change to "Restarting networking service to kickstart DHCP".

 - The user can now specify arguments that can be passed on to ping command
   when performing the connectivity check. The "args" field in the configuration
   section of the ztp.json needs to be specified.

 - The user can choose to restart dhcp if connectivity check fails in its first attempt.
   This is useful when the switch has rebooted and all the in-band interfaces are not
   yet active. Use "dhcp" : true in the configuration section of the ztp.json.

 - Added unit test cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants